
$(function () {
    queryYearthList("yearAnnual");
    var TRAIN_ZSTYPE=CONSTANT.DictionaryTypeDefConstants.TRAIN_ZSTYPE;//证书类型(数据字典)
    $.ajax({
        type: 'post',
        url: ROOT_PATH + '/permission/dictionary/queryDictionaryByDictionaryTypeCode.shtml',
        data: {code: TRAIN_ZSTYPE},
        dataType: "json",
        success: function (result) {
            $('#certificateTypeId').combobox({
                data: result,
                valueField: 'id',
                textField: 'text',
                editable: false,
                panelHeight: '200',
                multiple:true
            });
        }
    });
    $('#certificateTypeId').val(certificateTypeIdsValue.substring(1));
    /**
     * 绑定人员选择事件
     */
    $("#principal").textbox({
        iconWidth: 20,
        icons: [{
            iconCls: 'icon-add'
        },{
            iconCls: 'icon-remove'
        }]
    });
});
function queryYearthList(id){
    var date = new Date();
    var year = date.getFullYear();
    var yearthData = new Array();
    //yearthData.push({id:"",text:"请选择"});
    for(var i =0;i<6;i++){
        var y = {id:year-i,text:(year-i)+'年'}
        yearthData.push(y);
    }
    $('#'+id).combobox(
        {
            data:yearthData,
            valueField:'id',
            textField:'text',
            required:true
        }
    );
}
/**
 * 查询部门树方法
 */
function queryDepartmentTree(){
    $.ajax({
        url:ROOT_PATH + '/permission/department/getDepartmentTree.shtml',//提交地址
        data:{parentId : 0},//将表单数据序列化
        type:"POST",
        dataType:"json",
        success:function(result){
            $('#hostDeptId').combotree(
                {
                    data:result,
                    require:true
                }
            );
        }
    });
}
